<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    //return $request->user();
});


Route::group(['namespace' => 'Basic', 'prefix' => ''], function () {

    Route::get('/city', 'MiscController@city');
});
Route::group([], function () {

    Route::get('/changchun/info', 'OrgController@changChun');
    Route::any('/changchun/login', 'Auth\IndexController@changChunLogin');

});

Route::group([], function () {
    Route::post('login', 'Auth\IndexController@postLogin');
    Route::post('login/verifyphone', 'Auth\IndexController@verifyphone');
    Route::post('login/sms', 'Auth\IndexController@sms');
    Route::get('logout', 'Auth\IndexController@logout');
    Route::post('register', 'Auth\IndexController@postRegister');
    Route::get('/org/term/{term?}', 'OrgController@sug');
    Route::get('/team/term/{term?}', 'TeamController@sug');


    Route::group(['middleware' => 'auth.admin'], function () {
        Route::get('/dashboard', 'DashboardController@index');

        Route::get('/user/info', 'UserController@info');

        Route::get('/user/team', 'UserController@getTeamInfo');
        Route::post('/user/team', 'UserController@saveTeamInfo');
        Route::get('/user/org', 'UserController@getOrgInfo');
        Route::post('/user/org', 'UserController@saveOrgInfo');
        Route::get('/user/platform', 'UserController@getPlatformInfo');
        Route::post('/user/platform', 'UserController@savePlatformInfo');
        Route::get('/user/team-acl', 'UserController@getTeamAcl');
        Route::post('/user/team-acl', 'UserController@saveTeamAcl');
        Route::get('/user/inbox', 'UserController@inbox');
        Route::get('/user/outbox', 'UserController@outbox');
        Route::post('/user/send', 'UserController@send');
        Route::post('/user/markread/{id}', 'UserController@markread');

        Route::post('/user/verifyphone', 'UserController@verifyphone');
        Route::post('/user/bindphone', 'UserController@bindPhone');
        Route::post('/user/newpwd', 'UserController@resetPwd');


        Route::post('/banner/offline/{id}', 'BannerController@offline');
        Route::post('/banner/online/{id}', 'BannerController@online');
        Route::resource('banner', 'BannerController');
        Route::post('/org/offline/{id}', 'OrgController@offline');
        Route::post('/org/online/{id}', 'OrgController@online');
        Route::get('/org/sug/{term?}', 'OrgController@sug');
        Route::post('/org/{id}/settings', 'OrgController@saveSettings');
        Route::get('/org/{id}/infosettings', 'OrgSettingController@getConfigSettings');
        Route::post('/org/{id}/infosettings', 'OrgSettingController@saveConfigSettings');
        Route::put('/org/{id}/infosettings', 'OrgSettingController@editConfigSettings');
        Route::delete('/org/{id}/infosettings', 'OrgSettingController@deleteConfigSettings');
        Route::put('/org/{id}/sortinfosettings', 'OrgSettingController@sortConfigSettings');
        Route::get('/org/{id}/opensettings', 'OrgSettingController@getOpenConfigSettings');
        Route::post('/org/{id}/opensettings', 'OrgSettingController@setOpenConfigSettings');
        Route::get('/org/{id}/wechatmessage', 'OrgController@getWechatSettings');
        Route::post('/org/{id}/wechatmessage', 'OrgController@saveWechatSettings');
        Route::resource('org', 'OrgController');

        Route::get('/team/blacklist', 'TeamController@blacklist');
        Route::post('/team/black/{id}', 'TeamController@black');
        Route::post('/team/unblack/{id}', 'TeamController@unblack');
        Route::get('/team/verify', 'TeamController@verify');
        Route::post('/team/accept/{id}', 'TeamController@accept');
        Route::post('/team/reject/{id}', 'TeamController@reject');
        Route::get('/team/acl/{id}', 'TeamController@getAcl');
        Route::post('/team/acl/{id}', 'TeamController@saveAcl');
        Route::get('/team/chained/{id?}', 'TeamController@chained');
        Route::get('/team/sug', 'TeamController@sug');
        Route::post('/team/notify/{teamIds}', 'TeamController@notify');
        Route::post('/team/notify', 'TeamController@notify');
        Route::post('/team/star_certificate/accept/{id}', 'TeamController@starCertificateAccept');
        Route::post('/team/star_certificate/reject/{id}', 'TeamController@starCertificateReject');
        Route::resource('team', 'TeamController');

        Route::get('/project/verify', 'ProjectController@verify');
        Route::post('/project/accept/{id}', 'ProjectController@accept');
        Route::post('/project/reject/{id}', 'ProjectController@reject');
        Route::post('/project/refresh/{id}', 'ProjectController@refresh');
        Route::post('/project/recommend/{id}', 'ProjectController@recommend');
        Route::post('/project/unRecommend/{id}', 'ProjectController@unRecommend');
        Route::post('/project/online/{id}', 'ProjectController@online');
        Route::post('/project/offline/{id}', 'ProjectController@offline');
        Route::post('/project/cancel/{id}', 'ProjectController@cancel');
        Route::get('/project/pending', 'ProjectController@pending');
        Route::get('/project/processing', 'ProjectController@processing');
        Route::get('/project/outdated', 'ProjectController@outdated');
        Route::get('/project/draft', 'ProjectController@draft');
        Route::get('/project/buy-safe/{id}', 'ProjectController@buySafe');
        Route::get('/project/{projectId}/initCheckin', 'ProjectCheckinController@defaultValue');
        Route::resource('project', 'ProjectController');
        Route::resource('project.checkin', 'ProjectCheckinController');

        Route::get('/project/{projectId}/getSchema', 'ProjectHireController@getSchema');
        Route::get('/project/{projectId}/hire', 'ProjectHireController@index');
        Route::post('/project/{projectId}/hire/accept/{id}', 'ProjectHireController@accept');
        Route::post('/project/{projectId}/hire/reject/{id}', 'ProjectHireController@reject');
        Route::post('/project/{projectId}/sendMessage/{id}', 'ProjectHireController@sendMessage');


        Route::get('project/{projectId}/reward', 'ProjectRewardController@index');
        Route::post('project/{projectId}/reward/{ids}', 'ProjectRewardController@append');

        Route::post('/claim_project/refresh/{id}', 'ClaimProjectController@refresh');
        Route::post('/claim_project/online/{id}', 'ClaimProjectController@online');
        Route::post('/claim_project/offline/{id}', 'ClaimProjectController@offline');
        Route::resource('claim_project', 'ClaimProjectController');
        Route::resource('claim_project.apply', 'ClaimProjectApplyController');

        Route::get('/reward-apply', 'RewardController@index');
        Route::post('/reward-apply/accept/{id}', 'RewardController@accept');
        Route::post('/reward-apply/reject/{id}', 'RewardController@reject');

        Route::post('/safe_plan/banner/online/{id}', 'SafePlanBannerController@online');
        Route::post('/safe_plan/banner/offline/{id}', 'SafePlanBannerController@offline');
        Route::resource('safe_plan/banner', 'SafePlanBannerController');
        Route::post('/safe_plan/online/{id}', 'SafePlanController@online');
        Route::post('/safe_plan/offline/{id}', 'SafePlanController@offline');
        Route::get('/safe_plan/order', 'SafePlanController@order');
        Route::get('/safe_plan/plans', 'SafePlanController@plans');
        Route::get('/safe_plan/projects', 'SafePlanController@projects');
        Route::get('/safe_plan/buy-safe/{id}', 'SafePlanController@buySafe');
        Route::resource('safe_plan', 'SafePlanController');

        Route::get('/feeling_tone/comments', 'FeelingToneController@comments');
        Route::get('/feeling_tone/replies', 'FeelingToneController@replies');
        Route::post('/feeling_tone/comment', 'FeelingToneController@comment');
        Route::post('/feeling_tone/reply', 'FeelingToneController@reply');
        Route::delete('/feeling_tone/comment/{id}', 'FeelingToneController@destroyComment');
        Route::resource('feeling_tone', 'FeelingToneController');
        Route::resource('family', 'FamilyController');



        Route::resource('setting', 'SettingController');

        Route::post('/good_example/offline/{id}', 'GoodExampleController@offline');
        Route::post('/good_example/online/{id}', 'GoodExampleController@online');
        Route::resource('good_example', 'GoodExampleController');


        Route::post('/volunteer/notify/${userIds}', 'VolunteerController@notify');
        Route::post('/volunteer/notify', 'VolunteerController@notify');
        Route::get('/volunteer/applylist', 'VolunteerController@applylist');
        Route::post('/volunteer/accept/{id}', 'VolunteerController@accept');
        Route::post('/volunteer/reject/{id}', 'VolunteerController@reject');
        Route::post('/volunteer/notify/{userIds}', 'VolunteerController@notify');
        Route::post('/volunteer/import', 'VolunteerController@import');
        Route::post('/volunteer/export', 'VolunteerController@export');
        Route::get('/volunteer/blacklist', 'VolunteerBlacklistController@blacklist');
        Route::post('/volunteer/black/{id}', 'VolunteerBlacklistController@black');
        Route::post('/volunteer/unblack/{id}', 'VolunteerBlacklistController@unblack');
        Route::get('/volunteer/project/{id}', 'VolunteerController@project');
        Route::get('/volunteer/team/{id}', 'VolunteerController@team');
        Route::get('/volunteer/getSchema', 'VolunteerController@getSchema');
        Route::post('/volunteer/star_certificate/accept/{id}', 'VolunteerController@starCertificateAccept');
        Route::post('/volunteer/star_certificate/reject/{id}', 'VolunteerController@starCertificateReject');
        Route::resource('volunteer', 'VolunteerController');


        Route::delete('/group/{groupId}/{userId}', 'VolunteerGroupController@remove');
        Route::resource('group', 'VolunteerGroupController');
        Route::get('/group_name', 'VolunteerGroupController@getName');
        Route::post('/user_group/add/{id}', 'VolunteerGroupController@addVol2Group');
        Route::post('/user_group/remove/{id}', 'VolunteerGroupController@removeVol2Group');

        Route::get('/module', 'ModuleController@index');
        Route::get('/module/options', 'ModuleController@options');
        Route::post('/module', 'ModuleController@store');
        Route::put('/module/{id}', 'ModuleController@update');
        Route::post('/org/{org_id}/module', 'ModuleController@setOrgModule');

        Route::post('/image', 'StorageController@image');
        Route::post('/file', 'StorageController@file');
        Route::post('/upload/image', 'StorageController@image2');

        Route::get('/teamcashinfo/my', 'TeamCashInfoController@info');
        Route::resource('teamcashinfo', 'TeamCashInfoController');

        Route::get('/cash/project', 'TeamCashApplyController@cashProject');
        Route::get('/cash/apply', 'TeamCashApplyController@apply');
        Route::get('/cash/history', 'TeamCashApplyController@cashHistory');
        Route::post('/cash/verify/{id}', 'TeamCashApplyController@verify');
        Route::resource('cash', 'TeamCashApplyController');

        Route::resource('userorder', 'UserOrderController');

        Route::resource('news', 'NewsController');

        Route::get('/bindwechat', 'TeamController@bindWechat');
        Route::post('/bindwechat', 'TeamController@unbindWechat');

        Route::get('/statistics/volunteer/increase', 'StatisticsController@increaseVolunteer');
        Route::get('/statistics/volunteer/current', 'StatisticsController@currentVolunteer');
        Route::get('/statistics/volunteer/gender', 'StatisticsController@genderVolunteer');
        Route::get('/statistics/volunteer/age', 'StatisticsController@ageVolunteer');
        Route::get('/statistics/volunteer/area', 'StatisticsController@areaVolunteer');
        Route::get('/statistics/volunteer/city', 'StatisticsController@cityVolunteer');
        Route::get('/statistics/province_info', 'StatisticsController@sug');
        Route::get('/statistics/team/increase', 'StatisticsController@increaseTeam');
        Route::get('/statistics/team/type', 'StatisticsController@typeTeam');
        Route::get('/statistics/team/org', 'StatisticsController@orgTeam');
        Route::get('/statistics/team/area', 'StatisticsController@areaTeam');
        Route::get('/statistics/team/city', 'StatisticsController@cityTeam');
        Route::get('/statistics/project/increase', 'StatisticsController@increaseProject');
        Route::get('/statistics/project/type', 'StatisticsController@typeProject');
        Route::get('/statistics/project/org', 'StatisticsController@orgProject');
        Route::get('/statistics/project/area', 'StatisticsController@areaProject');
        Route::get('/statistics/project/city', 'StatisticsController@cityProject');
        Route::get('/statistics/reward/increase', 'StatisticsController@increaseReward');
        Route::get('/statistics/dailyproject/increase', 'StatisticsController@dailyJoinProject');
        Route::get('/statistics/dailyproject/reward', 'StatisticsController@dailyJoinReward');

        Route::get('/statistics/team', 'StatisticsController@team');
        Route::get('/statistics/project', 'StatisticsController@project');
        Route::get('/statistics/reward', 'StatisticsController@reward');
        Route::get('/statistics/joinProject', 'StatisticsController@joinProject');

        Route::get('/starsetting', 'StarSettingController@get');
        Route::post('/starsetting', 'StarSettingController@set');
//积分商城
        Route::resource('goods', 'GoodsController');
        Route::put('/goods/display/{id}', 'GoodsController@display');
        Route::put('/goods/is_display/{id}', 'GoodsController@isdisplay');
        Route::put('/goods/top/{id}', 'GoodsController@top');
        Route::put('/goods/down/{id}', 'GoodsController@down');

        Route::get('/auth/team', 'TeamController@authGoods');
        Route::post('/auth/team', 'TeamController@deleteAuthGoods');

        Route::get('/order', 'OrderController@orderlist');
        Route::put('/order/pass/{id}', 'OrderController@pass');
        Route::put('/order/refuse/{id}', 'OrderController@refuse');
        Route::get('/order/statistic', 'OrderController@orderStatistic');
        Route::get('/order/current_count', 'OrderController@currentOrderNum');
        Route::put('/order/{id}', 'OrderController@take');

        Route::put('/gbanner/offline/{id}', 'GoodsBannerController@offline');
        Route::put('/gbanner/online/{id}', 'GoodsBannerController@online');
        Route::resource('gbanner', 'GoodsBannerController');
//用户信息
        Route::get('platform/org/list', 'PlatformController@orglist');
        Route::post('platform/{id}/settings', 'PlatformController@saveSettings');
        Route::get('platform/{id}/org', 'PlatformController@org');
        Route::resource('platform', 'PlatformController');
        Route::post('platform/online/{id}', 'PlatformController@online');
        Route::post('platform/offline/{id}', 'PlatformController@offline');

    });
});





